Skip to content

Fix(Core): Optimize container loading when there are a large number of entities#1187

Merged
stonebuzz merged 1 commit intomainfrom
optimize_load
May 5, 2026
Merged

Fix(Core): Optimize container loading when there are a large number of entities#1187
stonebuzz merged 1 commit intomainfrom
optimize_load

Conversation

@stonebuzz
Copy link
Copy Markdown
Contributor

@stonebuzz stonebuzz commented Apr 24, 2026

…f entities

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes #42749

A user with nearly 5,000 entities is experiencing slowness when opening a ticket containing a container.

They are using a tree view with recursive mode enabled.

Currently, the plugin adds a WHERE clause on entities using all the user’s entities (glpi_active_entities), which significantly impacts performance.

The logic used to verify whether access to the container is authorized has been moved further downstream in order to lighten the SQL query.

It now relies on Session::haveAccessToEntity.

Screenshots (if appropriate):

@stonebuzz stonebuzz requested a review from Rom1-B April 24, 2026 08:00
@stonebuzz stonebuzz self-assigned this Apr 24, 2026
@stonebuzz stonebuzz added the bug label Apr 24, 2026
@stonebuzz stonebuzz changed the title Fix(Core): Optimize container loading when there are a large number o… Fix(Core): Optimize container loading when there are a large number of entities Apr 24, 2026
@stonebuzz
Copy link
Copy Markdown
Contributor Author

validated by customer

@stonebuzz stonebuzz merged commit ad1c1d0 into main May 5, 2026
1 check passed
@stonebuzz stonebuzz deleted the optimize_load branch May 5, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants